package com.example.primeiraaplicacao;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.Toast;

public class ExemploImageButton extends Activity
        implements OnClickListener{
	
	ImageButton btImg01, btImg02;
	public void onCreate(Bundle icicle){
		super.onCreate(icicle);
		setContentView(R.layout.exemplo_imagem_button);
		btImg01 = (ImageButton) findViewById(R.id.img01);
		btImg01.setOnClickListener(this);
		btImg02 = (ImageButton) findViewById(R.id.img02);
		btImg02.setOnClickListener(this);
		btImg02.setImageResource(R.drawable.smile2);
		
	}
	
	@Override
	public void onClick(View v) {
		//TODO Auto-generated method stub
		if(v==btImg01){
			Toast.makeText(this, "Imagem 1 OK", Toast.LENGTH_SHORT).show();
			
		}
		if(v==btImg02){
			Toast.makeText(this, "Imagem 2 OK", Toast.LENGTH_SHORT).show();
		}
	}
	
	

}
